<%@ page contentType="text/html;charset=UTF-8"%>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<%@ taglib uri="/WEB-INF/tlds/att.tld" prefix="att"%>
<html>
<head>
<script src="${staticPath}/lib/accounting/0.3.2/accounting.min.js"
	type="text/javascript"></script>
<script type="text/javascript">
	$(document).ready(function() {
		var http_request = false;
		function createXmlRequest() {
			if (window.ActiveXObject) { // IE浏览器
				try {
					http_request = new ActiveXObject("Msxml2.XMLHTTP");
				} catch (e) {
					try {
						http_request = new ActiveXObject("Microsoft.XMLHTTP");
					} catch (e) {
					}
				}
			} else {
				if (window.XMLHttpRequest) { //Mozilla 浏览器
					http_request = new XMLHttpRequest();
					if (http_request.overrideMimeType) {//设置MiME类别
						http_request.overrideMimeType("text/xml");
					}
				}
			}
		}

	});

	function doPrint() {
		bdhtml = window.document.body.innerHTML;
		sprnstr = "<!--startprint-->";
		eprnstr = "<!--endprint-->";
		prnhtml = bdhtml.substr(bdhtml.indexOf(sprnstr) + 17);
		prnhtml = prnhtml.substring(0, prnhtml.indexOf(eprnstr));
		window.document.body.innerHTML = prnhtml;
		window.print();
		setTimeout('window.close()', 5000);
	}
</script>
</head>
<body>
	<!--startprint-->
	<div style="background: #FFF; width: 100%">
		<div>
			<h3 class="center">缴款通知单</h3>
			<table class="table o-l-table table-bordered" id="table1"
				style="font-size:13.5px">
				<tbody>
					<tr>
						<td class="text-left" style="width: 15%">缴款单号:</td>
						<td style="width: 35%">${payinslip.billNo}</td>

						<td class="text-left" style="width: 15%">供应商编码:</td>
						<td style="width: 35%">${payinslip.supplierNo}</td>
					</tr>
					<tr>
						<td class="text-left" style="width: 15%">应缴金额:</td>
						<td style="width: 35%"><fmt:formatNumber
								value="${payinslip.amount}" pattern="##.##"
								minFractionDigits="2"></fmt:formatNumber></td>

						<td class="text-left" style="width: 15%">供应商名称:</td>
						<td style="width: 35%">${payinslip.supplierName}</td>
					</tr>
					<tr>
						<td class="text-left" style="width: 15%">收款公司:</td>
						<td style="width: 35%">${payinslip.collectingCompany}</td>

						<td class="text-left" style="width: 15%">开户行:</td>
						<td style="width: 35%">${payinslip.bankName}</td>
					</tr>
					<tr>


						<td class="text-left" style="width: 15%">银行帐号:</td>
						<td style="width: 35%">${payinslip.account}</td>
						<td class="text-left" style="width: 15%">公司地址:</td>
						<td style="width: 35%">${payinslip.address}</td>

					</tr>
					<tr>

						<td class="text-left" style="width: 15%">联系电话:</td>
						<td style="width: 35%">${payinslip.contactNumber}</td>

						<td class="text-left" style="width: 15%">开单日期:</td>
						<td style="width: 35%"><fmt:formatDate
								value="${payinslip.createTime}" pattern="yyyy-MM-dd" /></td>
					</tr>
					<tr>
						<td class="text-left" style="width: 15%">开单人:</td>
						<td style="width: 35%">${payinslip.createBy}</td>
					</tr>
				</tbody>
			</table>
		</div>
		<div>
			<h4>缴款明细</h4>
			<table
				class="table table-striped table-hover o-l-table table-bordered"
				id="table1" style="font-size:13.5px; text-align: center">
				<thead>
					<tr>
						<th style="width: 12%">合同号</th>
						<th style="width: 12%">缴费项目</th>
						<th style="width: 14%">缴费名称</th>
						<th style="width: 16%">起始日期</th>
						<th style="width: 14%">截止日期</th>
						<th style="width: 14%">应缴金额</th>
						<th style="width: 18%">备注</th>
					</tr>
				</thead>
				<tbody>
					<c:forEach items="${page.list}" var="payinDetail">
						<tr>
							<td>${payinDetail.contractNumber}</td>
							<td>${payinDetail.paymentItem}</td>
							<td>${payinDetail.desc}</td>
							<td><fmt:formatDate value="${payinDetail.startDate}"
									pattern="yyyy-MM-dd " /></td>
							<td><fmt:formatDate value="${payinDetail.endDate}"
									pattern="yyyy-MM-dd " /></td>
							<tddata-accounting="${payinDetail.amount}"
								data-accounting-precision="4"></td>
							<td>${payinDetail.remark}</td>
						</tr>
					</c:forEach>
				</tbody>
			</table>
		</div>
	</div>
	<!--endprint-->
	<div style="width: 75%" align="center">
		<button class="btn btn-default btn_5" onClick="doPrint();">
			打印</button>
		<button class="btn btn-default btn_5" onClick="window.close();">
			关闭</button>
	</div>
</body>
</html>